#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <vector>
#include <QMainWindow>
#include <QGraphicsScene>
#include <QTimer>
#include "grid.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    void setEvolution(std::vector<Grid*> &evolution);

    ~MainWindow();

private slots:
    void on_startButton_clicked();
    void update();
    void refresh();
    void on_nextButton_clicked();

    void on_prevButton_clicked();

    void on_resetButton_clicked();

private:
    Ui::MainWindow *ui;
    QGraphicsScene *scene;
    QTimer timer;
    static const unsigned int CELL_SIZE;
    static const unsigned int LINE_THICKNESS;
    static const unsigned int SIZE;
    static const QColor STATE_COLOR[8];
    static const QPen CELL_PEN;

    std::vector<Grid*> evolution;
    unsigned int step;
};


#endif // MAINWINDOW_H
